package cubelabs.nexus.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import cubelabs.nexus.entity.Category;
import cubelabs.nexus.entity.ScheduledCounsellingEvent;
import cubelabs.nexus.entity.User;

@Repository("scheduledCounsellingEventDAO")
public class ScheduledCounsellingEventDAO extends BaseDAO<ScheduledCounsellingEvent, Long>{
	
	public List<ScheduledCounsellingEvent> findAllEventsByUserId(User user) {
		Criteria crit = getSession().createCriteria(getPersistentClass());
		
		crit.add(Restrictions.eq("user", user));
		return crit.list();
	}

}
